﻿using STF.Blog.Common;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace STF.Blog.Model
{
    /// <summary>
    /// 管理员
    /// </summary>
    public class Admins:BaseEntity
    {

        [Required(ErrorMessage ="{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name ="账号")]
        public string Account { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "密码")]
        public string Pwd { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "昵称")]
        public string NickName { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Column(TypeName = "datetime")]
        [Display(Name = "出生日期")]
        public DateTime Birthday { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "性别")]
        public Gender Gender { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(255), Column(TypeName = "varchar(255)")]
        [Display(Name = "头像")]
        public string Photo { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "手机号")]
        public string Tel { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "QQ号")]
        public string QQNumber { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(255), Column(TypeName = "varchar(255)")]
        [Display(Name = "家庭住址")]
        public string Address { get; set; }
        public int RolesId { get; set; }    // 权限表外键
    }
}
